<template>
	<view style="padding:30 rpx;">
		<button @click="onSetTimeOut()" type="primary">单次计时器</button>
		<button @click="onSetTimeOut('zb',999)">启动传参计时器</button>
		<button @click="onClearTimeOut()" type="warn">取消计时器</button>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				name: 'lelele',
				timer1: null
			}
		},
		methods: {
			onSetTimeOut() {
				console.log("onSetTimeOut()");
				this.timer1 = SsetTimeout(() => {
					console.log("onSetTimeOut() callback");

					console.log("onSetTimeOut() callback end ");
				}, 3000);
			},
			onSetTimeOut(username, pwd){
				console.log("onSetTimeOut()",username,pwd);
				SetTimeout(()=>{
					console.log("-------callback",username,pwd,this.name);
					
				},2000,)
			}
		},
}
</script>

<style>

</style>